{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "import win32api\n",
    "import win32con\n",
    "import win32gui\n",
    "import win32ui\n",
    "\n",
    "from ctypes import *\n",
    "import time\n",
    "\n",
    "from PIL import ImageGrab,Image"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### VK_CODE"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "code_folding": [
     0
    ],
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "VK_CODE = {\n",
    "    'backspace':0x08,\n",
    "    'tab':0x09,\n",
    "    'clear':0x0C,\n",
    "    'enter':0x0D,\n",
    "    'shift':0x10,\n",
    "    'ctrl':0x11,\n",
    "    'alt':0x12,\n",
    "    'pause':0x13,\n",
    "    'caps_lock':0x14,\n",
    "    'esc':0x1B,\n",
    "    'spacebar':0x20,\n",
    "    'page_up':0x21,\n",
    "    'page_down':0x22,\n",
    "    'end':0x23,\n",
    "    'home':0x24,\n",
    "    'left_arrow':0x25,\n",
    "    'up_arrow':0x26,\n",
    "    'right_arrow':0x27,\n",
    "    'down_arrow':0x28,\n",
    "    'select':0x29,\n",
    "    'print':0x2A,\n",
    "    'execute':0x2B,\n",
    "    'print_screen':0x2C,\n",
    "    'ins':0x2D,\n",
    "    'del':0x2E,\n",
    "    'help':0x2F,\n",
    "    '0':0x30,\n",
    "    '1':0x31,\n",
    "    '2':0x32,\n",
    "    '3':0x33,\n",
    "    '4':0x34,\n",
    "    '5':0x35,\n",
    "    '6':0x36,\n",
    "    '7':0x37,\n",
    "    '8':0x38,\n",
    "    '9':0x39,\n",
    "    'a':0x41,\n",
    "    'b':0x42,\n",
    "    'c':0x43,\n",
    "    'd':0x44,\n",
    "    'e':0x45,\n",
    "    'f':0x46,\n",
    "    'g':0x47,\n",
    "    'h':0x48,\n",
    "    'i':0x49,\n",
    "    'j':0x4A,\n",
    "    'k':0x4B,\n",
    "    'l':0x4C,\n",
    "    'm':0x4D,\n",
    "    'n':0x4E,\n",
    "    'o':0x4F,\n",
    "    'p':0x50,\n",
    "    'q':0x51,\n",
    "    'r':0x52,\n",
    "    's':0x53,\n",
    "    't':0x54,\n",
    "    'u':0x55,\n",
    "    'v':0x56,\n",
    "    'w':0x57,\n",
    "    'x':0x58,\n",
    "    'y':0x59,\n",
    "    'z':0x5A,\n",
    "    'numpad_0':0x60,\n",
    "    'numpad_1':0x61,\n",
    "    'numpad_2':0x62,\n",
    "    'numpad_3':0x63,\n",
    "    'numpad_4':0x64,\n",
    "    'numpad_5':0x65,\n",
    "    'numpad_6':0x66,\n",
    "    'numpad_7':0x67,\n",
    "    'numpad_8':0x68,\n",
    "    'numpad_9':0x69,\n",
    "    'multiply_key':0x6A,\n",
    "    'add_key':0x6B,\n",
    "    'separator_key':0x6C,\n",
    "    'subtract_key':0x6D,\n",
    "    'decimal_key':0x6E,\n",
    "    'divide_key':0x6F,\n",
    "    'F1':0x70,\n",
    "    'F2':0x71,\n",
    "    'F3':0x72,\n",
    "    'F4':0x73,\n",
    "    'F5':0x74,\n",
    "    'F6':0x75,\n",
    "    'F7':0x76,\n",
    "    'F8':0x77,\n",
    "    'F9':0x78,\n",
    "    'F10':0x79,\n",
    "    'F11':0x7A,\n",
    "    'F12':0x7B,\n",
    "    'F13':0x7C,\n",
    "    'F14':0x7D,\n",
    "    'F15':0x7E,\n",
    "    'F16':0x7F,\n",
    "    'F17':0x80,\n",
    "    'F18':0x81,\n",
    "    'F19':0x82,\n",
    "    'F20':0x83,\n",
    "    'F21':0x84,\n",
    "    'F22':0x85,\n",
    "    'F23':0x86,\n",
    "    'F24':0x87,\n",
    "    'num_lock':0x90,\n",
    "    'scroll_lock':0x91,\n",
    "    'left_shift':0xA0,\n",
    "    'right_shift ':0xA1,\n",
    "    'left_control':0xA2,\n",
    "    'right_control':0xA3,\n",
    "    'left_menu':0xA4,\n",
    "    'right_menu':0xA5,\n",
    "    'browser_back':0xA6,\n",
    "    'browser_forward':0xA7,\n",
    "    'browser_refresh':0xA8,\n",
    "    'browser_stop':0xA9,\n",
    "    'browser_search':0xAA,\n",
    "    'browser_favorites':0xAB,\n",
    "    'browser_start_and_home':0xAC,\n",
    "    'volume_mute':0xAD,\n",
    "    'volume_Down':0xAE,\n",
    "    'volume_up':0xAF,\n",
    "    'next_track':0xB0,\n",
    "    'previous_track':0xB1,\n",
    "    'stop_media':0xB2,\n",
    "    'play/pause_media':0xB3,\n",
    "    'start_mail':0xB4,\n",
    "    'select_media':0xB5,\n",
    "    'start_application_1':0xB6,\n",
    "    'start_application_2':0xB7,\n",
    "    'attn_key':0xF6,\n",
    "    'crsel_key':0xF7,\n",
    "    'exsel_key':0xF8,\n",
    "    'play_key':0xFA,\n",
    "    'zoom_key':0xFB,\n",
    "    'clear_key':0xFE,\n",
    "    '+':0xBB,\n",
    "    ',':0xBC,\n",
    "    '-':0xBD,\n",
    "    '.':0xBE,\n",
    "    '/':0xBF,\n",
    "    '`':0xC0,\n",
    "    ';':0xBA,\n",
    "    '[':0xDB,\n",
    "    '\\\\':0xDC,\n",
    "    ']':0xDD,\n",
    "    \"'\":0xDE,\n",
    "    '`':0xC0}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 鼠标点击、双击、移动、输入文字"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "# def get_mouse_point():\n",
    "#     po = POINT()\n",
    "#     windll.user32.GetCursorPos(byref(po))\n",
    "#     return int(po.x),int(po.y)\n",
    "\n",
    "\n",
    "def mouse_click(x=None, y=None):\n",
    "    if not x is None and not y is None:\n",
    "        mouse_move(x, y)\n",
    "        time.sleep(0.05)\n",
    "    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)\n",
    "    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)\n",
    "\n",
    "\n",
    "def mouse_dclick(x=None, y=None):\n",
    "    if not x is None and not y is None:\n",
    "        mouse_move(x, y)\n",
    "        time.sleep(0.05)\n",
    "    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)\n",
    "    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)\n",
    "    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0)\n",
    "    win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0, 0, 0)\n",
    "\n",
    "\n",
    "def mouse_move(x, y):\n",
    "    windll.user32.SetCursorPos(x, y)\n",
    "\n",
    "\n",
    "def key_input(keybd_input):\n",
    "    for c in keybd_input:\n",
    "        win32api.keybd_event(VK_CODE[c], 0, 0, 0)\n",
    "        win32api.keybd_event(VK_CODE[c], 0, win32con.KEYEVENTF_KEYUP, 0)\n",
    "        time.sleep(0.01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "metadata": {},
   "outputs": [],
   "source": [
    "# win32api.keybd_event(VK_CODE['p'], 0, 0, 0)\n",
    "win32api.keybd_event(VK_CODE['p'], 0, win32con.KEYEVENTF_KEYUP, 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [],
   "source": [
    "if __name__ == \"__main__\":    \n",
    "#     mouse_click(500,280)\n",
    "    str1 = 'p'\n",
    "    key_input(str1)\n",
    "#     mouse_click(1000,280)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "### 无效代码"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'pyHook'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-1-b3f89897b639>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[1;32mimport\u001b[0m \u001b[0mpythoncom\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mpyHook\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      2\u001b[0m \u001b[1;32mdef\u001b[0m \u001b[0mOnMouseEvent\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mevent\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m:\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      3\u001b[0m     \u001b[0mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'MessageName:'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mevent\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mMessageName\u001b[0m \u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      4\u001b[0m     \u001b[0mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'Message:'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mevent\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mMessage\u001b[0m \u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m     \u001b[0mprint\u001b[0m \u001b[1;33m(\u001b[0m\u001b[1;34m'Time:'\u001b[0m\u001b[1;33m,\u001b[0m\u001b[0mevent\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mTime\u001b[0m \u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mModuleNotFoundError\u001b[0m: No module named 'pyHook'"
     ]
    }
   ],
   "source": [
    "import pythoncom, pyHook  \n",
    "def OnMouseEvent(event): \n",
    "    print ('MessageName:',event.MessageName )\n",
    "    print ('Message:',event.Message )\n",
    "    print ('Time:',event.Time )\n",
    "    print ('Window:',event.Window )\n",
    "    print ('WindowName:',event.WindowName )\n",
    "    print ('Position:',event.Position )\n",
    "    print ('Wheel:',event.Wheel) \n",
    "    print ('Injected:',event.Injected )\n",
    "    print( '---' )\n",
    "# 返回 True 可将事件传给其它处理程序，否则停止传播事件 \n",
    "    return True \n",
    "\n",
    "# 创建钩子管理对象 \n",
    "hm = pyHook.HookManager() \n",
    "# 监听所有鼠标事件 \n",
    "hm.MouseAll = OnMouseEvent # 等效于hm.SubscribeMouseAll(OnMouseEvent) \n",
    "# 开始监听鼠标事件 \n",
    "hm.HookMouse() \n",
    "# 一直监听，直到手动退出程序 \n",
    "pythoncom.PumpMessages()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 电脑左上角手机屏幕位置（7，55）\n",
    "    手机 宽364\n",
    "\n",
    "#### 手机屏幕比例 宽比长：1：2\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "mouse_move(6,52) "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "mouse_move(366,500)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "mouse_move(50,364*2+52)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "### 获取鼠标位置¶"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(849, 477)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "win32gui.GetCursorPos()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "def _input_left_mouse(x, y):\n",
    "        pos = win32gui.GetCursorPos()\n",
    "        win32api.SetCursorPos((x, y))\n",
    "        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN, 0, 0)\n",
    "        win32api.Sleep(100) #ms\n",
    "        win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP, 0, 0)\n",
    "        win32api.Sleep(100) #ms\n",
    "        # win32api.SetCursorPos(pos) \n",
    "_input_left_mouse(849, 477)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "### 获取屏幕分辨率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1536, 864)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def getResolution():\n",
    "    width = win32api.GetSystemMetrics(win32con.SM_CXSCREEN)\n",
    "    height = win32api.GetSystemMetrics(win32con.SM_CYSCREEN)\n",
    "    return width,height\n",
    "getResolution()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "### 修改屏幕分辨率"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(1536, 864)"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import win32api\n",
    "def setResolution(width= 1920,height= 1080):\n",
    "    dm = win32api.EnumDisplaySettings(None, 0)\n",
    "    dm.PelsHeight = height\n",
    "    dm.PelsWidth = width\n",
    "    dm.BitsPerPel = 32\n",
    "    dm.DisplayFixedOutput = 0\n",
    "    win32api.ChangeDisplaySettings(dm, 0)\n",
    "    \n",
    "setResolution()\n",
    "getResolution()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "### 句柄属性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "hidden": true
   },
   "outputs": [],
   "source": [
    "def show_window_attr(hWnd):  \n",
    "    ''''' \n",
    "    显示窗口的属性 \n",
    "    :return: \n",
    "    '''  \n",
    "    if not hWnd:  \n",
    "        return  \n",
    "   \n",
    "    #中文系统默认title是gb2312的编码  \n",
    "    title = win32gui.GetWindowText(hWnd)  \n",
    "    clsname = win32gui.GetClassName(hWnd)  \n",
    "   \n",
    "    print ('窗口句柄:%s ' % (hWnd)  )\n",
    "    print ('窗口标题:%s' % (title))  \n",
    "    print( '窗口类名:%s' % (clsname)  )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "3343924"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hwnd = win32gui.FindWindow(None,'TPG4C18109000027 (仅限非商业用途)')\n",
    "hwnd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "hidden": true,
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "窗口句柄:3343924 \n",
      "窗口标题:TPG4C18109000027 (仅限非商业用途)\n",
      "窗口类名:SunAwtFrame\n"
     ]
    }
   ],
   "source": [
    "show_window_attr(hwnd)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "heading_collapsed": true
   },
   "source": [
    "### 获取窗口尺寸  GetClientRect"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "hidden": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 0, 374, 824)"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "win32gui.GetClientRect(hwnd)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 获取窗口坐标（最后一个元组）"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(0, 1, (-1, -1), (-1, -1), (111, 27, 485, 851))\n",
      "(111, 27, 485, 851)\n"
     ]
    }
   ],
   "source": [
    "a = win32gui.GetWindowPlacement(hwnd)\n",
    "b = win32gui.GetWindowRect(hwnd)\n",
    "print (a)\n",
    "print(b)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## windows下两种截图方法"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 方法一："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.08395028114318848\n"
     ]
    }
   ],
   "source": [
    "def window_capture(filename,box):\n",
    "    '''\n",
    "    windows 窗口截图,保存为指定的filename\n",
    "    无返回值\n",
    "    '''\n",
    "    hwnd = 0 # 窗口的编号，0号表示当前活跃窗口\n",
    "    # 根据窗口句柄获取窗口的设备上下文DC（Divice Context）\n",
    "    hwndDC = win32gui.GetWindowDC(hwnd)\n",
    "    # 根据窗口的DC获取mfcDC\n",
    "    mfcDC = win32ui.CreateDCFromHandle(hwndDC)\n",
    "    # mfcDC创建可兼容的DC\n",
    "    saveDC = mfcDC.CreateCompatibleDC()\n",
    "    # 创建bigmap准备保存图片\n",
    "    saveBitMap = win32ui.CreateBitmap()\n",
    "    # 获取监控器信息\n",
    "    w = box[2] - box[0]\n",
    "    h = box[3] - box[1]\n",
    "    # 为bitmap开辟空间\n",
    "    saveBitMap.CreateCompatibleBitmap(mfcDC, w, h)\n",
    "    # 高度saveDC，将截图保存到saveBitmap中\n",
    "    saveDC.SelectObject(saveBitMap)\n",
    "    # 截取从左上角（0，0）长宽为（w，h）的图片\n",
    "    #  参数 (原点)（右下点） mfcDC （左上点）\n",
    "    saveDC.BitBlt((0,0), (box[2], box[3]), mfcDC, (box[0], box[1]), win32con.SRCCOPY)\n",
    "    saveBitMap.SaveBitmapFile(saveDC, filename)\n",
    "\n",
    "s1 = time.time()\n",
    "hwnd = win32gui.GetDesktopWindow()\n",
    "window_capture(r'C:\\Users\\wanzheng\\Desktop\\aa.jpg',win32gui.GetWindowPlacement(hwnd)[4])\n",
    "Image.open(r'C:\\Users\\wanzheng\\Desktop\\aa.jpg')\n",
    "print(time.time()-s1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 0, 1536, 864)"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "win32gui.GetWindowPlacement(hwnd)[4]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 0, 1536, 864)"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hwnd = win32gui.GetDesktopWindow()\n",
    "win32gui.GetClientRect(hwnd)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 方法二："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 284,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.05169486999511719\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 284,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "s1 = time.time()\n",
    "a = ImageGrab.grab(win32gui.GetWindowRect(hwnd))\n",
    "print (time.time()-s1)\n",
    "b = ImageGrab.grab(win32gui.GetWindowRect(hwnd))\n",
    "a == b"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 286,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "(0, 0, 488, 1051)"
      ]
     },
     "execution_count": 286,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "hwnd = win32gui.FindWindow(None,'TPG4C18109000027 (仅限非商业用途)')\n",
    "hwnd\n",
    "win32gui.GetWindowRect(hwnd)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.4"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
